package pointer

import (
	"fmt"
)

func Execute() {
	TestCreatePointer()
}

func TestCreatePointer() {
	originVar := "12345"

	pointer1 := &originVar
	fmt.Printf("pointer1 address: %v\n", pointer1)
	fmt.Printf("pointer1 value: %v\n", *pointer1)

	var pointer2 *string = new(string)
	fmt.Printf("pointer2 address: %v\n", pointer2)
	fmt.Printf("pointer2 value: %v\n", *pointer2)

	*pointer2 = "456"
	fmt.Printf("pointer2 value: %v\n", *pointer2)

	var pointer3 *string
	fmt.Printf("pointer3 address: %v\n", pointer3)

}
